fig <- plot_ly(
x = c("Buttigieg", "Warren", "Klobuchar", "Sanders", "O'Rourke"),
y = c(74, 73, 70, 67, 64),
type = "bar",
color = "orange"
)
fig <- fig %>% layout(title = "Candidates with Most Campaign Events",
xaxis = list(title = "Candidate"),
yaxis = list (title = "Number of Campaign Events"))
figProducts <- c("IA", "NH", "SC", "DC", "CA")
Incidences <- c(200, 132, 90, 86, 69)
df <- data.frame(Products, Incidences)
#Data Visualisation
fig <- df %>% plot_ly(labels = ~Products, values = ~Incidences)
fig <- fig %>% add_pie(hole = 0.6)
fig <- fig %>% layout(
title = "States with Most Campaign Events", showlegend = F,
xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE))
fig